1. Field of the Invention
The present invention generally relates to an image processing apparatus and, more particularly, to an image processing apparatus for dividing an in put image (to be referred to as a composite image hereinafter) having various kinds of input images, e.g., a typed character image, a handwritten character image, a photographic image, and a graphic pattern image, into areas of the respective kinds of images, and performing image processing such as data compression.
2. Description of the Related Art
Conventionally, when an image having continuously changing gradation (to be referred to as a continuous gradation image) such as a composite image (document image) having a character image, a graphic pattern image, a photographic image, and the like is to be filed as digital data, the image data is compressed to perform efficient data transfer for storing or communicating the data.
When a composite image is to be imaged by an image pickup unit, and image processing such as data compression is to be performed, it is generally desirable that the image be divided into areas having relatively different characteristics, e.g. a character area, a graphic pattern area, and a photographic area, and processing suitable for each area be performed.
As a method of dividing such a composite image into a character string area, a graphic pattern area, a photographic area, and the like, the following method is generally used. In this method, an overall image is decomposed into coupled components, and some kind of integration is performed to set areas as groups of the coupled components.
For example, as disclosed in "Image Area Division Scheme for Composite Image Having Character Image and Graphic Pattern Image (Halftone Image, Photographic Image)" THE TRANSACTIONS OF THE INSTITUTE OF ELECTRONICS, INFORMATION AND COMMUNICATION ENGINEERS OF JAPAN, D-II, Vol. J75-D-II, No. 1, pp. 39-47, Jan. 1992!, the following conventional scheme is used to determine a character image. First, edge emphasis processing is performed. Ternary processing is then performed by determination processing based on a proper threshold value. Areas in which black and white pixels continue are subjected to pattern matching to detect edge areas, thereby determining character image areas.
In addition, as disclosed in Jpn. Pat. Appln. KOKAI Publication No. 61-296481, there is proposed a document reader in which an input binary document image is reduced, and neighboring black pixels are integrated to detect an area.
As shown in FIG. 40, this document reader comprises an image information storage section 401 for storing binary image (document image) data obtained by optically scanning a document and photoelectrically converting the resultant data, a reduced image storage section 402 for dividing the document image data stored in the image information storage section 401 into small areas, reducing each small area to one pixel, and storing the resultant data, a black pixel integrating section 403 for scanning the reduced image data in a character-string direction and integrating neighboring black pixels, and an area detecting section 404 for detecting areas, of the image obtained by the black pixel integrating section 403, in which black pixels are coupled to each other as image areas.
The binary document image data stored in the image information storage section 401 is divided into small areas, each consisting of a predetermined number of pixels. If the number of black pixels in each small area is equal to or larger than a predetermined threshold value, a black pixel is assigned to each area. If the number of black pixels is less than the threshold value, a white pixel is assigned to each area. The resultant data is then stored in the reduced image storage section 402.
The black pixel integrating section 403 scans the reduced image data in a character-string direction and converts a white run having a length smaller than a predetermined threshold value into a black run, thus integrating neighboring black pixels. In the area detecting section 404, areas, of the image obtained by the black pixel integrating section 403, in which black pixels are coupled to each other are detected as image areas. With this operation, the image areas contained in the document can be detected.
A conventional image information processing system has a processing function of classifying an input composite image according to the kinds of images and converting the classified data into digital data.
One purpose of this processing is to minimize the total data amount of a composite image, when the composite image is stored in a storage medium in the form of digital data, while desired information quality is maintained, by using compression methods which allow data compression with the maximum efficiencies for all kinds of images. The other purpose is to adaptively select binarization methods to obtain better images when images classified as binary gradation images, e.g., character and line images, and continuous gradation images, e.g., a photographic image are expressed as binary images.
There are proposed various processing methods of dividing and classifying the composite image into description areas for all kinds of images. In many of these methods, feature amounts based on the kinds of images are extracted, and the extracted feature amounts are judged by predetermined estimation functions or decision functions, thus determining kinds of images. In many conventional image processing schemes, the frequency of occurrence of black pixels or edges, a luminance level histogram, a spatial frequency distribution, a line segment directivity distribution, and the like within a predetermined block area of an image are used as feature amounts. In addition, Jpn. Pat. Appln. KOKOKU Publication No. 4-18350 discloses a classification processing method using a density gradient frequency distribution of an input image as a feature amount, which is also used in the present invention. In this method, density gradients of a digital image as an input image are obtained in units of pixels in the horizontal and vertical directions, and directions calculated from the values of the obtained horizontal and vertical density gradients are counted in a divided small area, thereby obtaining its frequency distribution. The variance of the frequencies is calculated from the frequency distribution, and the variance is compared with a predetermined threshold value to determine whether the area is a character area or not.
In order to properly perform classification of image data by using the above-described conventional methods, the image data needs to be an ideal image in a relatively good state, including no noise and the like. In reality, however, input image data tends to be influenced by illumination irregularity, stains of a file document, or the like. In such an image, the contrast locally decreases or noise is generated. As a result, detection of black pixels and edge extraction cannot be performed stably. Therefore, it is very difficult to accurately determine kinds of images by using the conventional methods using black pixel detection and edge extraction as parameters.
Furthermore, in order to perform the above-described area division of a composite image without omitting end portions of image areas, it is required that the edge portions such as the end points of characters be faithfully reflected in reduction of an image. In the conventional techniques, however, an input binary composite image is divided into small areas, and a black pixel is assigned to each small area in which the number of black pixels is equal to or larger than a threshold value. If, therefore, the threshold value is larger than "0", a small area located at an end of an image area is not detected, resulting in omission of a portion. If the threshold value is set to be "0", a large amount of noise is picked up, and correction division processing cannot be performed.
In addition, in a reverse monochrome composite image, the overall document image is extracted as a large area.
The above-described distribution of directions calculated from a density threshold value can properly reflect the directivity distribution of edge portions of an image. Therefore, this distribution represents an effective feature amount for determining whether a given image is a typed character image having many edge components in the vertical and horizontal directions, for the difference between a typed character image and other kinds of images is conspicuous. To use the variance of distributions as an estimation criterion for performing determination on the basis of this feature amount is to observe localization of the directivity of edges. In addition, calculation of this variance can be performed with a relatively small calculation load, and hence this method is practical.
If only the variance of the direction distributions of density gradients is used for threshold determination, accurate determination is difficult to perform with respect to the following images: a so-called low-contrast image in which the range of luminance (density) levels is narrow; an image in which the ratio of the occupied area of character edge portions to a determination target small area is small; and an image in which the lines of a character are narrow; because the variance is reduced even if the image to be processed is a typed character image. This is because the direction distribution of density gradients of a background increases in frequency, and the relative difference in direction distribution between the background and a character portion cannot be recognized. Since the direction distribution of density gradients of a background generally has no direction dependency, the direction dependency of the direction distribution of the edges of a character portion is hidden by the distribution of the background.
Furthermore, when various kinds of images (a hand-written character image, a photographic image, a graphic pattern image, and a background image) as well as a typed character image are to be selected and classified, these images cannot be discriminated from each other at all by only observing the variance of the direction distribution of density gradients.